
<h2>How to create your own fields</h2>

<p>Once you've grasped the main ideas behind inputEx, you'll probably want to create your own fields. Here are some hints  on how to do so :</p>

	
<div>
	<p><b><u>Choose the right parent Class</u></b></p>
	
	<p>Look at the classes to pick the "closest" one. (in terms of code)<br />
		 If you want to start from scratch, you should inherit from inputEx.Field</p>
		
	<p>use <i>YAHOO.extend</i> to extend classes</p>
</div>
	


<div>
	<p><b><u>Override methods</u></b></p>

	<p>Some methods have a precise role :</p>
		
	<ul>
		<li><i>setOptions</i> : declare the options and their default value</li>
		<li><i>render</i> : create a wrapper around the field DOM and insert the component</li>
		<li><i>renderComponent</i> : render the DOM for your field</li>
		<li><i>initEvents</i> : subscribe to events once rendered</li>
		<li><i>getValue</i> : get the value of your field</li>
		<li><i>setValue</i> : set the value of your field</li>
	</p>
</div>
	
<div>
	<p><b><u>Send the updated event</u></b></p>
	
	<p>Fire this event to indicate modifications (with <i>this.fireUpdatedEvt()</i>)</p>
</div>
	
<div>
	<p><b><u>Register your type</u></b></p>
	
	<p>After your class definition, you can associate your class to a type string. 
		 You can either create a new type, or override a previous one.</p>
	
	<p>use <i>inputEx.registerType("myType", inputEx.MyFieldClass);</i></p>
	
</div>

	